#include <stdio.h>
#include <unistd.h>
#include <string.h>

#define SIZE 101
#define STYLE '='

void process()
{
    char processbuff[SIZE];
    memset(processbuff, '\0', sizeof(processbuff));
    int cnt = 0;
    const char* lable = "|/-\\";
    int len = strlen(lable);
    while(cnt <= 100)
    {
        printf("[%-100s][%d%%][%c]\r", processbuff, cnt, lable[cnt%len]);
        fflush(stdout);
        processbuff[cnt++] = STYLE; 
        sleep(2);
    }
    printf("\n");
}

int main()
{
    process();
    return 0;
}
